const fs = require('fs');
const path = require('path');

// const readable = fs.createReadStream(path.resolve(__dirname, 'input.txt'));
const readable = fs.createReadStream(path.resolve(__dirname, 'xuanchuanpian.mp4'));

readable.on('data', (chunk) => {
  console.log(`Received ${chunk.length} bytes of data.`);
});

readable.on('end', () => {
  console.log('Data reading is finished.');
  readable.close();
});

readable.on('close', () => {
  console.log('Stream is closed.');
});
